package com.wms_backend.dao;

import com.wms_backend.entity.Floor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.concurrent.atomic.AtomicReference;


@Repository
public interface FloorDao extends JpaRepository<Floor,Integer>{


    @Query("select f.id from Floor f where f.status='1' order by f.id limit :unit")
    List<Integer> getSomeSpace(Integer unit);

    @Query("select count(*) from Floor f where f.status='1'and f.shelfId=:shelfId ")
    Integer getStatusOneNumber(Integer shelfId);

    List<Floor> getFloorsByShelfId(Integer shelfId);

    List<Floor> findByInboundId(Integer inboundId);

    List<Floor> findByShelfIdInAndStatus(List<Integer> shelfIds, String status);

}
